/**
 *    Copyright (C) 2008, 2009  Victor Smirnov <aist11@gmail.com>
 *
 *    This program is free software; you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation; either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License along
 *    with this program; if not, write to the Free Software Foundation, Inc.,
 *    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 *    See LICENSE.exceptions in the root folder of this project for possible
 *    exceptions
 *
 */

#ifndef _CUBEFS_API_MACRO_HPP
#define	_CUBEFS_API_MACRO_HPP

#define CUBEFS_JOIN( X, Y ) CUBEFS_INT0_JOIN( X, Y )
#define CUBEFS_INT0_JOIN( X, Y ) CUBEFS_INT1_JOIN(X,Y)
#define CUBEFS_INT1_JOIN( X, Y ) X##Y

#define CUBEFS_STRINGIFY(x) #x
#define CUBEFS_TOSTRING(x) CUBEFS_STRINGIFY(x)

#define CUBEFS_AT CUBEFS_TOSTRING(__LINE__)

// general API export/import macros
#if defined(__GNUC__)
#   if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
        // XXX visibility is available in GCC 3.4 and higher
#       define CUBEFS_EXPORT __attribute__((visibility("default")))
#       define CUBEFS_NO_EXPORT __attribute__((visibility("hidden")))
#       define CUBEFS_IMPORT /*!*/
#   else
#       define CUBEFS_EXPORT /*!*/
#       define CUBEFS_NO_EXPORT /*!*/
#       define CUBEFS_IMPORT /*!*/
#   endif
#elif defined MSVC
#   define CUBEFS_EXPORT __declspec(dllexport)
#   define CUBEFS_NO_EXPORT /*!*/
#   define CUBEFS_IMPORT /*__declspec(dllimport)*/
#else
#   define CUBEFS_EXPORT /*!*/
#   define CUBEFS_NO_EXPORT /*!*/
#   define CUBEFS_IMPORT /*!*/
#endif

#define CUBEFS_API CUBEFS_EXPORT


#endif
